package com.sc.nft.entity.vo;

import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class TradingTrendVO {

    @ApiModelProperty("最新成交价")
    private String latestTransactionPrice;

    @ApiModelProperty("今日最高价")
    private String todaySHighest;

    @ApiModelProperty("今日最低价")
    private String todaySLowest;

    @ApiModelProperty("今日成交量")
    private Integer turnover;

    @ApiModelProperty("地板价")
    private String priceFloor;

    public void setLatestTransactionPrice(BigDecimal latestTransactionPrice) {
        this.latestTransactionPrice =ObjectUtil.isEmpty(latestTransactionPrice)?"0": latestTransactionPrice.setScale(2, BigDecimal.ROUND_DOWN).stripTrailingZeros().toPlainString();
    }

    public void setTodaySHighest(BigDecimal todaySHighest) {
        this.todaySHighest = ObjectUtil.isEmpty(todaySHighest)?"0":todaySHighest.setScale(2, BigDecimal.ROUND_DOWN).stripTrailingZeros().toPlainString();
    }

    public void setTodaySLowest(BigDecimal todaySLowest) {
        this.todaySLowest =ObjectUtil.isEmpty(todaySLowest)?"0": todaySLowest.setScale(2, BigDecimal.ROUND_DOWN).stripTrailingZeros().toPlainString();
    }

    public void setPriceFloor(BigDecimal priceFloor) {
        this.priceFloor =ObjectUtil.isEmpty(priceFloor)?"0": priceFloor.setScale(2, BigDecimal.ROUND_DOWN).stripTrailingZeros().toPlainString();
    }

}
